﻿using StarPizza.Model.BaseModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StarPizza.ViewModel.ManagerSystem
{
    public class OrderedPizzaReportVM
    {
        OrderedPizzaInfo pizzaInfo;
        public OrderedPizzaReportVM(OrderedPizzaInfo orderedPizzaInfo)
        {
            this.pizzaInfo = orderedPizzaInfo;
        }
        public bool IsCustomPizzza { get { return pizzaInfo.PizzaTemplateID == null; } }
        public PizzaTemplate PizzaTemplate
        {
            get
            {
                if (IsCustomPizzza)
                    return null;
                else
                    return pizzaInfo.PizzaTemplate;
            }
        }
        public Client Client { get { return pizzaInfo.OrderInfo.Client; } }
        public string UniqueID { get { return pizzaInfo.OrderInfoID + "/" + pizzaInfo.PizzaIndex; } }

        public string ClientName { get { return Client.Name; } }
        public int District { get { return Client.District; } }
        public string Address { get { return Client.Address; } }
        public DateTime OrderDate { get { return pizzaInfo.OrderInfo.OrderDate; } }
        public int Price { get { return pizzaInfo.Price; } }
        public string PizzaDescription 
        { 
            get 
            {
                string pizzaName;
                if (IsCustomPizzza)
                    pizzaName = "Egyéni pizza";
                else
                    pizzaName = PizzaTemplate.Name;
                return pizzaName + " (" + Size + " cm)";
            } 
        }
        public int Size { get { return pizzaInfo.Size; } }
    }
}
